<script>
export default {
  name: "IndexView"
}
</script>

<template>
  <el-container style="height: 100vh;">
    <!-- 顶部导航栏 -->
    <el-header class="header">
      <el-menu
          mode="horizontal"
          background-color="#304156"
          text-color="#fff"
          active-text-color="#409EFF"
          class="header-menu"
      >
        <el-menu-item index="1">首页</el-menu-item>
        <el-menu-item index="2">学生管理</el-menu-item>
        <el-menu-item index="3">用户管理</el-menu-item>
        <el-menu-item index="4">订单管理</el-menu-item>
        <el-menu-item index="5">系统设置</el-menu-item>
      </el-menu>
    </el-header>

    <el-container>
      <!-- 侧边栏导航 -->
      <el-aside width="200px" class="aside">
        <el-menu
            default-active="1"
            class="el-menu-vertical-demo"
            background-color="#304156"
            text-color="#fff"
            active-text-color="#409EFF"
        >
          <el-submenu index="1">
            <template #title>
              <i class="el-icon-user"></i>
              <span>学生管理</span>
            </template>
            <el-menu-item index="1-1">
              <router-link to="/student" class="menu-link">学生列表</router-link>
            </el-menu-item>
            <el-menu-item index="1-2">用户权限</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template #title>
              <i class="el-icon-goods"></i>
              <span>用户管理</span>
            </template>
            <el-menu-item index="2-1">产品列表</el-menu-item>
            <el-menu-item index="2-2">产品分类</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template #title>
              <i class="el-icon-tickets"></i>
              <span>订单管理</span>
            </template>
            <el-menu-item index="3-1">订单列表</el-menu-item>
            <el-menu-item index="3-2">订单统计</el-menu-item>
          </el-submenu>
          <el-submenu index="4">
            <template #title>
              <i class="el-icon-setting"></i>
              <span>系统设置</span>
            </template>
            <el-menu-item index="4-1">系统参数</el-menu-item>
            <el-menu-item index="4-2">日志管理</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <!-- 内容区域 -->
      <el-main class="main">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<style scoped>
.header {
  background-color: #304156;
  color: #fff;
  line-height: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-menu {
  border-bottom: none;
}

.aside {
  background-color: #304156;
  color: #fff;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.main {
  background-color: #f5f7fa;
  color: #333;
  padding: 20px;
  border-radius: 8px;
  margin: 16px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.el-menu {
  border-right: none;
}

.el-menu-item {
  padding: 0 20px;
  transition: background-color 0.3s;
}

.el-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.el-submenu .el-menu-item {
  padding: 0 40px;
}

.menu-link {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
}

.el-icon-user,
.el-icon-goods,
.el-icon-tickets,
.el-icon-setting {
  margin-right: 8px;
}
</style>